package com.twelve.service.impl;


import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import java.util.List;

import com.twelve.bean.Collumn;
import com.twelve.dao.CollumnMapper;
import com.twelve.service.CollumnService;
import com.twelve.utils.JqgridUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CollumnServiceImpl extends ServiceImpl<CollumnMapper, Collumn> implements CollumnService {
	@Autowired
	private JqgridUtil jqgridUtil;
	
	@Override
	public String getShowJson(int page, int count) {

        List<Collumn> all = baseMapper.selectList(null);
        int toIndex = count * page;
        if (all.size() < toIndex) {
            toIndex = all.size();
        }
        List<Collumn> list = all.subList(count * (page - 1), toIndex);
        return jqgridUtil.getJson(list, page + "", all.size() , count);
    
	}

}
